// pages/list/more/more.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    moreArr: [],
  },
  formSubmit: function (e) {
    console.log(e)
    var more = e.detail.value;
    if (more['more_name'] == '') {
      wx.showToast({
        title: '名称不能为空',
        icon: 'none',
        duration: 2000
      })
    } else if (more['more_content'] == '') {
      wx.showToast({
        title: '内容不能为空',
        icon: 'none',
        duration: 2000
      })
    } else if (more['signature'] == '') {
      wx.showToast({
        title: '请输入短信签名',
        icon: 'none',
        duration: 2000
      })
    } else {
      var moreStorage = wx.getStorageSync("more");
      var moreArr = [];
      for (var i in moreStorage) {
        moreArr.push(moreStorage[i])
      }
      moreArr.push(more)
      wx.setStorageSync('more', moreArr)

      wx.switchTab({
        url: '/pages/list/more/more-list',
      })
    }
  },

})